package com.wwg.component;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


/**
 * @description 获取Spring上下文 
 * @version V1.0
 */  
@Component("myApplicationContextAware")
public class MyApplicationContextAware implements ApplicationContextAware {
	@SuppressWarnings("unused")
	private static ApplicationContext myApplicationContext;

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		myApplicationContext = applicationContext;
	}
	
	public static ApplicationContext getApplicationContext(){
		return myApplicationContext;
	}

}
